package cn.kent.heima.base.stack;

/**
 * demo-栈内存溢出 java.lang.StackOverflowError
 * -Xss128k 22894
 * -Xss256k 32713
 */
@SuppressWarnings("all")
public class Demo_01 {
    private static int count;
    public static void main(String[] args) {
        try {
            method();
        } catch (Throwable e) {
            e.printStackTrace();
            System.out.println(count);
        }
    }

    private static void method() {
        count++;
        method();
    }

}
